/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.safetytask.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.common.domain.DataBean;
import com.koron.safetytask.domain.CustomFormData;
import org.swan.bean.MessageBean;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public interface CustomFormDataService {

    /**
     * 批量新增
     *
     * @param beanList
     * @return
     */
    MessageBean<Integer> batchInsert(List<CustomFormData> beanList);

    /**
     * 批量修改
     *
     * @param beanList
     * @return
     */
    MessageBean<Integer> batchUpdate(List<CustomFormData> beanList);

    /**
     * 批量删除
     *
     * @param idList 表单id集合
     * @return
     */
    MessageBean<Integer> batchDelete(List<String> idList);

    /**
     * 条件查询
     *
     * @param tbaleCode   表格编码
     * @param addUser     添加人code
     * @param addUserName 添加人name
     * @param start       开始页
     * @param rows        每页条数
     * @return
     */
    MessageBean<DataBean<List<Map>>> queryByCondition(String tbaleCode, String businessId, String addUser, String addUserName, Integer start, Integer rows);

    /**
     * 根据表格编码查询表格详情
     *
     * @param tbaleCode
     * @return
     */
    MessageBean<LinkedHashMap> details(String tbaleCode, String businessId);


    /**
     * 根据表格编码和关联业务id查询最高行id
     *
     * @param tbaleCode
     * @param userTaskId
     * @return
     */
    MessageBean<Integer> queryMaxRow(String tbaleCode, String userTaskId);

    /**
     * 获取任务相关所有的填写的表单信息
     * @param tbaleCode
     * @param businessId
     * @param start
     * @param pageSize
     * @return
     */
    MessageBean<DataBean<List<Map>>> queryAllByCondition(StaffBean user,
                                                         String tbaleCode,
                                                         String businessId,
                                                         Integer start,
                                                         Integer pageSize,
                                                         String addUser,
                                                         String addUserName);
}
